-
Notifications
You must be signed in to change notification settings - Fork 90
feat: add AI agent docs integration to install script #288
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: add AI agent docs integration to install script #288
Conversation
- Download llm.txt to ~/.config/mcpm/ during installation - Detect common AI agent instruction files (CLAUDE.md, agents.md) - Offer to append MCPM documentation reference with local/remote URLs - Use HTML comment markers to prevent duplicate insertions
WalkthroughA new Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
|||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
pages/install (1)
167-224: Solid AI-doc integration; considercurldetection and non-interactive safety.The overall approach (config dir +
llm.txtdownload, marker-guarded block, opt‑in prompt) looks good and should be idempotent.Two refinements worth considering:
- Handle systems without
curlmore explicitlyRight now a missing
curljust falls into the generic “Could not download” branch, with the real error suppressed (2>/dev/null). A small guard would give clearer behavior on minimal systems:- info "Downloading MCPM documentation for AI agents..." - mkdir -p "$MCPM_CONFIG_DIR" - if curl -sSL "$LLM_TXT_URL" -o "$MCPM_LLM_TXT" 2>/dev/null; then - info "Saved AI agent documentation to $MCPM_LLM_TXT" - else - info "Could not download llm.txt (will use GitHub URL as fallback)" - fi + info "Downloading MCPM documentation for AI agents..." + mkdir -p "$MCPM_CONFIG_DIR" + if command_exists curl; then + if curl -sSL "$LLM_TXT_URL" -o "$MCPM_LLM_TXT" 2>/dev/null; then + info "Saved AI agent documentation to $MCPM_LLM_TXT" + else + info "Could not download llm.txt (will use GitHub URL as fallback)" + fi + else + info "curl not found; will only reference remote docs URL in AI agent instructions" + fi
- Avoid surprises under
set -ein non-interactive runs
read -punderset -ewill cause the script to exit if stdin is already at EOF (e.g. non-interactive automation). A simple TTY check before prompting avoids that:- for file in "${AI_INSTRUCTION_FILES[@]}"; do + # Skip interactive prompts when stdin is not a TTY (e.g., automated installs) + if [ ! -t 0 ]; then + info "Non-interactive shell detected; skipping AI agent documentation prompts" + return + fi + + for file in "${AI_INSTRUCTION_FILES[@]}"; doOptionally, you could also gate the
setup_ai_agent_docscall inmainso it only runs whenmcpmis actually onPATH:- verify_installation - setup_ai_agent_docs + verify_installation + if command_exists mcpm; then + setup_ai_agent_docs + fiThis keeps the integration robust in both interactive and automated install flows while preserving your current UX.
Also applies to: 233-233
User description
Summary
This PR enhances the install script to better support AI coding assistants (Claude Code, Cursor, etc.) by:
llm.txtlocally to~/.config/mcpm/llm.txtduring installation for fast, offline access~/CLAUDE.md~/.claude/CLAUDE.md~/agents.md~/.config/claude/CLAUDE.mdWhat gets added to user's instruction files
Features
Test plan
PR Type
Enhancement
Description
Downloads
llm.txtdocumentation to~/.config/mcpm/llm.txtfor offline AI agent accessDetects common AI instruction files (CLAUDE.md, agents.md) in standard locations
Offers to append MCPM documentation reference with local and remote URLs
Uses HTML comment markers to prevent duplicate insertions on reinstall
Diagram Walkthrough
File Walkthrough
install
Add AI agent docs integration functionpages/install
setup_ai_agent_docs()function to download and integrate MCPMdocumentation
llm.txtfrom GitHub to~/.config/mcpm/llm.txtfor offlineaccess
agents.md variants)
idempotency markers
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.